Conversation
Split out into a separate piece because this adds a patch to libuv
that has non-trivial downsides, as explained in the referenced PR.
I'd assume that mitigating this through a `process.on('exit')` handler
is sufficient and that we don't need to plan specifically for e.g.
hard crashes of mongosh here, but I didn't want to merge this together
with the original work in 4232a98 but rather have it stand
on its own (including for the simple reason that it's easier to revert
if we decide that we have to).
| #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 | ||
| #endif | ||
| +#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT | ||
| +#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200 |
There was a problem hiding this comment.
what is the significance of the 0x0200 value? is it just an available value?
There was a problem hiding this comment.
You can look up the values here: https://learn.microsoft.com/en-us/windows/console/setconsolemode#parameters
This #define, like the one above, is added in case the compilation happens on a Windows machine that doesn't have the most recent system headers and doesn't know about the flag yet, so you can still compile a program that can make use of it when run on more recent Windows machines.
That's not a practical concern for mongosh, but for the libuv PR it's relevant.
gagik
left a comment
There was a problem hiding this comment.
Very unfamiliar territory for me but seems to make sense.
|
Alright, I'll go ahead with this, even though we know it's quite likely that we'll need to adjust the libuv patch here a bit more. |
Split out into a separate piece because this adds a patch to libuv that has non-trivial downsides, as explained in the referenced PR. I'd assume that mitigating this through a
process.on('exit')handler is sufficient and that we don't need to plan specifically for e.g. hard crashes of mongosh here, but I didn't want to merge this together with the original work in 4232a98 but rather have it stand on its own (including for the simple reason that it's easier to revert if we decide that we have to).Refs: libuv/libuv#4688